﻿@inject IStringLocalizer<InputNumbersStep> Localizer

<div>
    <div class="demo-inputnumber">
        <p>@Localizer["InputNumbersStep1"]</p>
        <BootstrapInputNumber ShowButton="true" Value="5" Color="Color.Danger" />
    </div>
    <div class="demo-inputnumber mt-3">
        <p>@Localizer["InputNumbersStep10"]</p>
        <BootstrapInputNumber ShowButton="true" Value="10" Step="10" Color="Color.Success" />
    </div>
    <div class="demo-inputnumber mt-3">
        <p>@Localizer["InputNumbersStep0.1"]</p>
        <BootstrapInputNumber ShowButton="true" Value="0.5" Step="0.1" Formatter="@Formatter" Color="Color.Warning" />
    </div>
</div>

<style>
    .demo-inputnumber {
        width: 160px;
    }

        .demo-inputnumber > .form-control {
            width: inherit;
        }
</style>

@code {
    private static string Formatter(double val) => val.ToString("0.0");
}
